var uuid = ka.uuidStr();
var forecastinforlistHtml = "";
// G0003	质量管理部 G0006	切削科  G0007	一次研削科 G0008	热处理 G0007 一次研削科 G0010	二次研削科 G0010	装配科 G0011	生产计划科 G0023	施设部 G0024	模具部 G0026	保全科 
var str = [
    {"code": "G0003", "name": "质量管理部"},
    {"code": "G0006", "name": "切削科"},
    {"code": "G0008", "name": "热处理"},
    {"code": "G0009", "name": "二次研削科"},
    {"code": "G0010", "name": "装配科"},
    {"code": "G0011", "name": "生产计划科"},
    {"code": "G0023", "name": "施设部"},
    {"code": "G0024", "name": "模具部"},
    {"code": "G0026", "name": "保全科"},
    {"code": "G0007", "name": "一次研削科"}
];
for (var i in str){
    forecastinforlistHtml = forecastinforlistHtml + `<div class="layui-card">
        <div class="layui-card-header">` + str[i].name + `</div>` ;
    var option = kaValue.getUrl("forecastinforlist");
    option.async = false;
    option.url = option.url + "?bmno=" + str[i].code;
    forecastinforlistHtml = forecastinforlistHtml + `<div class="layui-card-body"><ul>`;
    option.success = function (re) {
        if (re.code == 200) {
            var forecastinforlist = re.bmnoMap;
            for(var key in forecastinforlist){
                var keyMap = forecastinforlist[key];
                for(var keySon in keyMap){
                    forecastinforlistHtml = forecastinforlistHtml + `<li style="height: 20px;margin-left: 20px;margin-top: 10px;"><a href="` + (kaValue.ctx() + "/kingdee/forecastm/dcwd?bmno=" + keyMap[keySon]  + "&storenumber=" + keySon) + `" target="_bank">` + key + `</a></li>`
                }
            }
        } else {
            kaMsg.error(re);
        }
    }
    ka.ajax(option);
    forecastinforlistHtml = forecastinforlistHtml + `</ul>`;
    forecastinforlistHtml = forecastinforlistHtml + `
        </div>
      </div>`;
}

var index = layui.layer.open({
    type: 1, // page 层类型
    area: ['537px', '360px'],
    title: `导出文件`,
    offset: ['20%', '30%'],
    shade: [0.6, '#FFF'], // 点击遮罩区域，关闭弹层
    maxmin: false, // 允许全屏最小化
    anim: 0, // 0-6 的动画形式，-1 不开启
    content:  forecastinforlistHtml,
    success: function () {
    }
});



var value = d.value;
var uuid = ka.uuidStr();
return `
<input id="`+uuid+`_id" name="`+uuid+`_id" type="hidden" value="` +  d.data.id +`">
<input id="`+uuid+`_column" name="`+uuid+`_column" type="hidden" value="bydgsl">
<input id="`+uuid+`_url" name="`+uuid+`_url" type="hidden" value="SZBYQDLForecast">
<input id="`+uuid+`_value" name="`+uuid+`_value" type="text" value="` +  value +`" onchange="kagrid.columnrender.changeDOnchange('` + uuid +`')" autocomplete="off" lay-affix="clear" class="layui-input" style="border: 0px!important;height: 100%;box-shadow: unset;padding-left: 0px !important;">
`;